if status is-interactive
    function proxy
      set -xg ALL_PROXY http://127.0.0.1:7890
    end
    function noproxy
      set -e ALL_PROXY
    end

    function piproxy
      set -xg ALL_PROXY http://127.0.0.1:1055
    end
    function nopiproxy
      set -e ALL_PROXY
    end
end

# pnpm
set -gx PNPM_HOME "$HOME/Library/pnpm"
if not string match -q -- $PNPM_HOME $PATH
  set -gx PATH "$PNPM_HOME" $PATH
end
# pnpm end

# set -gx PATH $HOME/workspace/self/all_in_one/scripts $PATH
set -gx PATH $HOME/Library/Python/3.9/bin $PATH

alias gitlog='git log --stat --graph --decorate --show-signature'
alias vim='nvim'
alias vi='nvim'

[ -f ~/.inshellisense/key-bindings.fish ] && source ~/.inshellisense/key-bindings.fish
bind -e \ca inshellisense-widget


# add brew path
set --global --export HOMEBREW_PREFIX "/usr/local";
set --global --export HOMEBREW_CELLAR "/usr/local/Cellar";
set --global --export HOMEBREW_REPOSITORY "/usr/local/Homebrew";
fish_add_path --global --move --path "/usr/local/bin" "/usr/local/sbin";
if test -n "$MANPATH[1]"; set --global --export MANPATH '' $MANPATH; end;
if not contains "/usr/local/share/info" $INFOPATH; set --global --export INFOPATH "/usr/local/share/info" $INFOPATH; end;


status --is-interactive; and pyenv init --path | source
status --is-interactive; and pyenv init - | source


set -gx NPM_PACKAGES $HOME/.npm-packages
set -gx PATH $HOME/bin:$NPM_PACKAGES/bin $PATH

# esp setting
set -gx PATH $HOME/esp/xtensa-esp32-elf/bin $PATH
set -gx IDF_PATH $HOME/esp/v5.4.1/esp-idf
set -gx PATH $IDF_PATH/tools $PATH
set -gx PATH $HOME/.espressif/tools/xtensa-esp-elf/bin $PATH
set -gx PATH $HOME/.espressif/tools/esp32ulp-elf/2.38_20240113/esp32ulp-elf/bin $PATH
set -gx PATH $HOME/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/bin $PATH
set -gx PATH $HOME/.espressif/python_env/idf5.4_py3.12_env/bin $PATH
set -gx PATH $HOME/.espressif/tools/xtensa-esp-elf-gdb/14.2_20240403/xtensa-esp-elf-gdb/bin $PATH


# Commands to run in interactive sessions can go here
# Unset manpath so we can inherit from /etc/manpath via the `manpath` command
set -gx MANPATH $NPM_PACKAGES/share/man $manpath
set -gx PATH /usr/local/opt/gettext/bin $PATH
set -gx NODE_PATH $HOME/.npm-packages/lib/node_modules

# bun
set --export BUN_INSTALL "$HOME/.bun"
set --export PATH $BUN_INSTALL/bin $PATH
